package com.yanqu.road.server.cmd.chefduel.process2;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.chefduel.ChefDuelProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.chefduel.CrossChefDuelMgr;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.C_CROSS_CHEF_DUEL2_USER_TABLE_INFO, desc = "小当家第2阶段cooker的桌子")
public class CrossCookerTableInfoCmd extends CrossCommand {

    private long userId;
    private int activityId;
    private long homeUserId;
    private int tableId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        ChefDuelProto.CrossChefDuel2CookerTableReqMsg reqMsg = ChefDuelProto.CrossChefDuel2CookerTableReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        activityId = reqMsg.getActivityId();
        homeUserId = reqMsg.getUserId();
        tableId = reqMsg.getTableId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossChefDuelMgr.getCookerTable(activityId,serverId,userId,homeUserId,tableId);
    }

    @Override
    public void sendData() {

    }

}
